using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class SEOTagMap : EntityTypeConfiguration<SEOTag>
    {
        public SEOTagMap()
        {
            // Primary Key
            this.HasKey(t => t.SEOTag_id);

            // Properties
            this.Property(t => t.TagName)
                .HasMaxLength(50);

            this.Property(t => t.Country)
                .HasMaxLength(2);

            this.Property(t => t.PageTitle)
                .HasMaxLength(200);

            this.Property(t => t.PageDescription)
                .HasMaxLength(400);

            // Table & Column Mappings
            this.ToTable("SEOTag");
            this.Property(t => t.SEOTag_id).HasColumnName("SEOTag_id");
            this.Property(t => t.TagName).HasColumnName("TagName");
            this.Property(t => t.ParentId).HasColumnName("ParentId");
            this.Property(t => t.Country).HasColumnName("Country");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
            this.Property(t => t.PageTitle).HasColumnName("PageTitle");
            this.Property(t => t.PageDescription).HasColumnName("PageDescription");
        }
    }
}
